// 获取今天为星期几
const getWeek = (dayValue) => {
  const day = new Date(); // 将日期值格式化
  const today = []; // 创建星期数组
  const weeks = [
    { id: 0, name: '日', fullName: '周日' },
    { id: 1, name: '一', fullName: '周一' },
    { id: 2, name: '二', fullName: '周二' },
    { id: 3, name: '三', fullName: '周三' },
    { id: 4, name: '四', fullName: '周四' },
    { id: 5, name: '五', fullName: '周五' },
    { id: 6, name: '六', fullName: '周六' },
  ];
  weeks.map((item) => {
    today.push(item.fullName);
    return true;
  });
  return today[day.getDay()]; // 返一个星期中的某一天，其中0为星期日
};

// 获取今天的日期信息
const getNewDateInfo = () => {
  const dateInfo = {};
  const nowYY = new Date().getFullYear();
  const nowMM = new Date().getMonth() + 1;
  const nowDD = new Date().getDate();
  const nowDate = `${nowYY}-${nowMM < 10 ? `0${nowMM}` : nowMM}-${nowDD < 10 ? `0${nowDD}` : nowDD}`;

  dateInfo.takeoffDate = nowDate;
  dateInfo.week = '今天';// getWeek();
  return dateInfo;
};
export default { getNewDateInfo };
